package com.dense.kuiniu.floatcabinet.mvp.http.entity;

import android.os.Parcel;
import android.os.Parcelable;

import java.util.List;

/**
 * @author Administrator
 * @date 2020/11/11
 */
public class BorrowBackResult implements Parcelable {

    private boolean isSucceed;
    private List<BorrowBook> borrowList;
    private List<Book> backList;

    public boolean isSucceed() {
        return isSucceed;
    }

    public void setSucceed(boolean succeed) {
        isSucceed = succeed;
    }

    public List<BorrowBook> getBorrowList() {
        return borrowList;
    }

    public void setBorrowList(List<BorrowBook> borrowList) {
        this.borrowList = borrowList;
    }

    public List<Book> getBackList() {
        return backList;
    }

    public void setBackList(List<Book> backList) {
        this.backList = backList;
    }

    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeByte(this.isSucceed ? (byte) 1 : (byte) 0);
        dest.writeTypedList(this.borrowList);
        dest.writeTypedList(this.backList);
    }

    public BorrowBackResult() {
    }

    protected BorrowBackResult(Parcel in) {
        this.isSucceed = in.readByte() != 0;
        this.borrowList = in.createTypedArrayList(BorrowBook.CREATOR);
        this.backList = in.createTypedArrayList(Book.CREATOR);
    }

    public static final Parcelable.Creator<BorrowBackResult> CREATOR = new Parcelable.Creator<BorrowBackResult>() {
        @Override
        public BorrowBackResult createFromParcel(Parcel source) {
            return new BorrowBackResult(source);
        }

        @Override
        public BorrowBackResult[] newArray(int size) {
            return new BorrowBackResult[size];
        }
    };
}